package com.ruoyi.user.service.impl;

import com.ruoyi.user.domain.AppUserRole;
import com.ruoyi.user.mapper.AppUserRoleMapper;
import com.ruoyi.user.service.AppUserRoleService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;


@Service
public class AppUserRoleServiceImpl implements AppUserRoleService {

    @Autowired
    private AppUserRoleMapper appUserRoleMapper;

    @Override
    public int addAppUserRole(AppUserRole appUserRole) {

        return appUserRoleMapper.insertAppUserRole(appUserRole);
    }

    @Override
    public int removeAppUserRole(Integer appUserId) {
        return appUserRoleMapper.deleteAppUserRole(appUserId);
    }

    @Override
    public int editAppUserRole(AppUserRole appUserRole) {
        return appUserRoleMapper.insertAppUserRole(appUserRole);
    }

    @Override
    public Set<String> getAppUserRole(AppUserRole appUserRole) {
        return appUserRoleMapper.selectAppUserRole(appUserRole);
    }

    @Override
    public List<Integer> getRoleId(Integer appUserId) {
        return appUserRoleMapper.selectRoleId(appUserId);
    }
}
